package com.example.flashlight7;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.ToggleButton;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
        final ToggleButton mybutton = (ToggleButton) findViewById(R.id.toggleButton1);
        mybutton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                if (mybutton.isChecked()) {
                	mybutton.setBackgroundColor(0xFFFFFFFF);
                	mybutton.setTextColor(0xFF000000);
                }
                else {
                	mybutton.setBackgroundColor(0xFF000000);
                	mybutton.setTextColor(0xFFFFFFFF);
                }
            }
        });
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}
	
		
	}


